package com.edocbase.desktop.search;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;

public class SearchActivator implements BundleActivator {
	public static final String ID = "com.edocbase.desktopsearcher";
	private ServiceRegistration searchReg;

	@Override
	public void start(BundleContext context) throws Exception {
		searchReg = context.registerService(ISearchEngine.class.getName(), SearchEngine.getEngine(), null);
		System.out.println("search activator start..... ");
	}

	@Override
	public void stop(BundleContext context) throws Exception {
		System.out.println("search activator stop ...");
		SearchEngine.shutdown();
		searchReg.unregister();
	}

}
